<html>
<head>
	<meta charset='utf-8' />
	<title>后台管理</title>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
	<style>
		@media screen and (max-width:450px){
			#Content,#Nav_bottom,#Back_Btn{width:98%;margin:0 auto}

			/*页面宽度900以下时 .abc的宽度为450*/
		}
		@media screen and (min-width:450px){
			#Content,#Nav_bottom,#Back_Btn{width:450px;margin:0 auto}
			/*页面宽度900以下时 .abc的宽度为450*/
		}
	</style>
</head>
<body style='padding:0;margin:0;background:#eaa'>



	<!-- 1 Content容器 -->
	<div id='Content' style=''>

		<h2 style='color:red;text-align:center'>后台管理登陆</h2>

		<div style='text-indent:80px;margin:20px auto'>
			区　域：
			<span id='LoginCityAreaName' style='display:none'></span>
			<span id='LoginCityAreaChange' style='color:blue;margin-left:20px;display:none'>切换</span>
			<div id='LoginCityArea'>
				<select id="Login_Province"></select>
				<select id="Login_City"></select>
				<select id="Login_County"></select>
			</div>
		</div>

		<div style='text-indent:80px;'>
			登陆名：<input id='Login_User' style='width:230px'/>
		</div>

		<div style='text-indent:80px;margin:20px auto'>
			密　码：<input id='Login_Pwd' type='password' style='width:230px'/>
		</div>


		<div style='text-indent:80px;margin:20px auto'>
			验证码：<input id='Login_Code' style='width:70px'/>
			<img src="interface.php?type=code" align='top' alt="点击" style='width:100px;height:40px' id="Login_Code" onclick="ChangeCode(this)">
		</div>

		<div style='text-align:center'>
			<button  id='Login_Sub'>登陆</button>
		</div>

	</div><!-- 1 Content容器结束 -->



</body>
</html>




<script src='../Public/jquery.js'></script>
<script src='../Public/fun.js'></script>

<script>
	var OpenCityObj;	//保存开通城市数据容器
	var StatusSetObj; 	//保存状态集合容器


	GetStatusSet(function(StatusSet){		//### 从localStorage，upyun获取状态集合，并定期更新
		if(/^{.*}$/.test(StatusSet)){
			StatusSetObj = JSON.parse(StatusSet);
			var CheckName = 'city_open';
			var le = localStorage.OpenCityExpire;
											//检测状态集合中指定字段是否过期
			var res = CheckStatusIsExpire(StatusSetObj,CheckName,le);	
			if(res == 'err'){
				localStorage.OpenCity = '';		//清空本地开通城市数据
			}
											//获取并填充城市数据
			CityInit(OpenCityObj,Login_Province,Login_City,Login_County,function(){},234);
		}else{
			C('获取状态集合失败 from login.html in line 88');
			//JumpError('../error.html?t=400012');	//400012 获取状态集合失败
		}
	});

	//初始化城市信息




	$('#Login_Sub').click(function(){
		var User = ChangeChar($('#Login_User').val().trim());
		var Pwd = ChangeChar($('#Login_Pwd').val().trim());
		var Code = ChangeChar($('#Login_Code').val().trim());


		if(!User || !Pwd || !Code){
		//	return;
		}

		if(Login_County.innerHTML.length < 1){
			if(User != 'admin'){
				A('系统异常！请稍候再试！');return;
			}else{
				var County = 'null,null,null';
				var CountyName = 'null';
			}
		}else{
			var County = Login_County.options[Login_County.selectedIndex].value;
			var CountyName = Login_County.options[Login_County.selectedIndex].innerHTML;
		}




		//Field_Check(/^[a-z]\w{4,19}$/,User,'js登陆名非法!');
		//Field_Check(/^\w{4}$/,Code,'js验证码不正确!');

		var data = {
			User:User,
			Pwd:Pwd,
			Code:Code,
			County:County,
			type:'AdminLogin'
		};

		Ajax2(data,function(res){
			if(res == 'ok'){
				sessionStorage.admin_name = User;	//缓存当前登陆的管理员账号
				sessionStorage.CountyName = CountyName; 	//缓存当前选择的区域名
				location.replace('main.html');
			}else if(res == 'err1'){
				A('缺少信息！');
			}else if(res == 'err2'){
				A('验证码不正确!');
			}else{
				A('用户名或密码不正确！');
			}
		},'interface.php');
	});






</script>










